/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.testis.threading;

import org.testis.utils.StringUtils;


/**
 *
 * @author nurhat
 */
public abstract class Task implements Runnable
{

    protected String m_taskId;
    protected boolean m_cancelled;


    public Task(String taskId)
    {
        setTaskId(StringUtils.trimAll(taskId));
    }


    public String getTaskId()
    {
        return m_taskId;
    }


    public void setTaskId(String taskId)
    {
        this.m_taskId = taskId;
    }


    public abstract void afterExecute();


    public boolean isCancelled()
    {
        return m_cancelled;
    }


    public void setCancelled(boolean cancelled)
    {
        this.m_cancelled = cancelled;
    }


    @Override
    public String toString()
    {
        return "Task with id: " + m_taskId;
    }
}

